package com.aqie.medium;

/**
 * 540 有序数组中单一元素 todo
 */
public class SingleNonDuplicate {
    public static int singleNonDuplicate(int[] nums) {
        return 0;

    }

    public static int singleNonDuplicate2(int[] nums) {
        int num = nums[0];
        for (int i = 1; i < nums.length; i++){
            num ^= nums[i];
        }
        return num;
    }

    public static void main(String[] args) {
        int[] arr = {1,1,2,3,3,4,4,8,8};
        System.out.println(singleNonDuplicate(arr));
    }
}
